package tests;


import Common.Utils;
import org.openqa.selenium.By;

public class appStatisticPage extends Utils {
    public static String url = "http://localhost:8080/app_statistic";

    public appStatisticPage() {
        super(url);
    }


    //检查页面是否加载成功
    public void appStatisticPageRight() throws InterruptedException {
        //通过查看页面元素是否存在来检查页面加载成功与否
        driver.findElement(By.cssSelector("#appStatisticPage > h2:nth-child(1)"));
        Thread.sleep(1000);
    }

    //检查页面是否加载成功
    public void findAppStatisticPage() throws InterruptedException {
        driver.navigate().refresh();
        //通过查看页面元素是否存在来检查页面加载成功与否
        driver.findElement(By.cssSelector("#appStatisticPage > div.search-bar > span > span.arco-input-wrapper > input")).clear();
        driver.findElement(By.cssSelector("#appStatisticPage > div.search-bar > span > span.arco-input-wrapper > input")).sendKeys("1");
        driver.findElement(By.cssSelector("#appStatisticPage > div.search-bar > span > span.arco-input-append > button")).click();
        Thread.sleep(1000);
        //回到主页
        driver.findElement(By.cssSelector("   #globalHeader > div:nth-child(1) > div > div > div > div.arco-menu-item.arco-menu-selected")).click();
    }
}
